package com.uum.blog.controller;

import com.uum.blog.service.BlogService;
import com.uum.common.core.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Api(tags = "首页相关接口")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/v1/doc")
public class InitController {

    private final BlogService blogService;

    @ApiOperation(value = "一年文章贡献度")
    @GetMapping("listBlogContributeCount")
    public Result listBlogContributeCount() {
        Map<String, Object> resultMap = blogService.listBlogContributeCount();
        return Result.success(resultMap);
    }

    @ApiOperation(value = "分类饼图数据")
    @GetMapping("listCategoryPieData")
    public Result listCategoryPieData() {
        Map<String, Object> resultMap = blogService.listCategoryPieData();
        return Result.success(resultMap);
    }

    @ApiOperation(value = "标签饼图数据")
    @GetMapping("listTagPieDate")
    public Result listTagPieDate() {
        Map<String, Object> resultMap = blogService.listTagPieDate();
        return Result.success(resultMap);
    }

    @ApiOperation(value = "最近最多阅读的博文")
    @GetMapping("MFU")
    public Result MFU() {
        //全站最近最多阅读的博文
        //个人最近最多阅读的博文
        //时间-3个月
        //点击量最多
        return Result.success();
    }
}
